<%@page import="utils.Saver"%>
<%@page import="net.sf.json.JSONObject"%>
<%@page import="java.io.BufferedReader"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	response.setCharacterEncoding("UTF-8");
	request.setCharacterEncoding("UTF-8");
	response.setHeader("Cache-Control", "no-cache"); // HTTP 1.1
	response.setHeader("Pragma", "no-cache"); // HTTP 1.0
	response.setDateHeader("Expires", 0);// Prevents caching at the proxy server
	response.setContentType("text/html;charset=UTF-8");
	response.setHeader("Access-Control-Allow-Origin", "*");

	System.out.print("\tfrom:" + request.getRemoteAddr() + ":");
	System.out.println(request.getRemotePort());
	System.out.println("\tuser:" + request.getRemoteUser());
	System.out.println();
	StringBuffer str = new StringBuffer();
	BufferedReader reader = request.getReader();
	String line = null;
	try {
		while ((line = reader.readLine()) != null)
	str.append(line);
	} catch (Exception e) {
		System.out.println(e);
	}
	Saver saver = new Saver();
	out.write(saver.save(request.getRemoteAddr(),request.getRemotePort(),str.toString())+"");
%>
